//**************************************************************************************
// Customer Generated Class File
//**************************************************************************************
//**** DO NOT CHANGE THIS FILE.  THE CONTENTS WILL BE OVERRIDEN ON NEXT MODEL SAVE. ****
//**************************************************************************************
using System;
using System.ComponentModel;
using DevExpress.ExpressApp;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Persistent.Validation;
using DevExpress.Xpo;

namespace Demo.Module
{
	[ImageName("BO_Unknown")]
	[CreatableItem(true)]
	[NavigationItem(true)]
	[DefaultListViewOptions()]
	public partial class Customer : XPLiteObject
	{
		public Customer() : base()
		{
		}

		public Customer(Session session) : base(session)
		{
		}

		private Int32 m_id;
		[Key(true)]
		public Int32 Id
		{
			get { return m_id; }
			set { SetPropertyValue("Id", ref m_id, value); }
		}

		private String m_firstName;
		[Size(25)]
		public String FirstName
		{
			get { return m_firstName; }
			set { SetPropertyValue("FirstName", ref m_firstName, value); }
		}

		private String m_lastName;
		[Size(25)]
		[RuleRequiredField("Customer_LastName_RuleRequiredField", DefaultContexts.Save, "Last name is required.")]
		public String LastName
		{
			get { return m_lastName; }
			set { SetPropertyValue("LastName", ref m_lastName, value); }
		}

		private String m_fullName;
		[Size(50)]
		[PersistentAlias("FirstName + ' ' + LastName")]
		public String FullName
		{
			get { return EvaluateAlias("FullName") as String; }
		}

		[Association("BusinessModel.CustomerOrder")]
		[Aggregated]
		public XPCollection<Order> Orders
		{
		    get
		    {
    		    return GetCollection<Order>("Orders");
		    }
		}

	}
}
